package IO;

/**
 * 自定义枚举类
 *构造器私有化  防止直接  new
 * 去掉set方法  防止属性被修改
 *
 *
 * @author
 * @version [版本], 创建时间:   更新时间:
 */
public class ENUM02 {
    public static void main(String[] args) {
        System.out.println(ENUM02.SPRING);
    }
    private String name;
    private String desc;
    public static final ENUM02 SPRING = new ENUM02("春天","得劲");
    public static final ENUM02 WINTER = new ENUM02("冬天","寒冷");
    public static final ENUM02 SUMMER = new ENUM02("夏天","炎热");
    public static final ENUM02 AUTUMN = new ENUM02("秋天","凉快");
    private ENUM02(String name,String desc){
        this.name = name;
        this.desc = desc;
    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public String toString() {
        return "ENUM02{" +
                "name='" + name + '\'' +
                ", desc='" + desc + '\'' +
                '}';
    }
}
